﻿<Window x:Class="mskold.TfsAdminToolKit.Views.FileSearch"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:mskold.TfsAdminToolKit.ViewModels"
        xmlns:src="clr-namespace:Sogeti.SourceControlWrapper"
        Title =" Search for LARGE files" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="350" Width="333">
    <Window.DataContext >
        <vm:FileSearchViewModel />
    </Window.DataContext>
    <Window.Resources>
            <src:EnumDescriptionConverter x:Key="enumConverter"/>
        <Style x:Key="RightAlignCell" TargetType="{x:Type DataGridCell}">
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
        <HierarchicalDataTemplate x:Key="NodeTemplate">
            <!--<TreeViewItem x:Name="tvNode" Header ="{Binding XPath=@Name}" IsHitTestVisible="True" IsTabStop="True" IsSelected="{Binding XPath=@IsSelected, Mode=TwoWay}" Focusable="True"/>-->
            <StackPanel Orientation="Horizontal">
                <Label Name="tvNode" Padding="2" Content="{Binding Path=FolderName}" />
                <Label Name="lblSize" Padding="2" Content="{Binding Path=SizeTxt}" />
            </StackPanel>
            <HierarchicalDataTemplate.ItemsSource>
                <Binding Path="Folders" />
            </HierarchicalDataTemplate.ItemsSource>
        </HierarchicalDataTemplate>
        <src:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
    </Window.Resources>

    <Grid >
        <ProgressBar Height="16"  Name="progressBar" Margin="12,80,12,0" VerticalAlignment="Top" />
        <Label Content="Label"  Padding="0" Margin="12,80,12,0" Name="lblProgress" VerticalAlignment="Top" FontSize="10" Opacity="1" HorizontalContentAlignment="Center" />
        <Label Content="Filename" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="84,14,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding Path=FileNameFilter}" />
        <Label Content="Min filesize" Height="28" HorizontalAlignment="Left" Margin="12,37,0,0" Name="label2" VerticalAlignment="Top" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="84,39,0,0" Name="textBox2" VerticalAlignment="Top" Width="68" Text="{Binding Path=FileSize}" TextAlignment="Right" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="158,39,0,0" Name="comboBox1" VerticalAlignment="Top" Width="46" ItemsSource="{Binding Path=FileSizeUnit, Converter={StaticResource enumConverter}, ConverterParameter=List}" SelectedValue="{Binding Path=FileSizeUnit, Converter={StaticResource enumConverter}, Mode=TwoWay}" />
        <Button Content="Search" Height="45" HorizontalAlignment="Left" Margin="221,17,0,0" Name="cmdSearch" VerticalAlignment="Top" Width="75" Click="cmdSearch_Click" />
        <DataGrid AutoGenerateColumns="False"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="12,124,12,0" Name="dataGrid1"  ItemsSource="{Binding Path=FoundFiles, Mode=TwoWay, IsAsync=True}">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Deleted}" Header="Deleted" />
                <DataGridTextColumn Binding="{Binding Path=FilePath}" Header="Filename" />
                <DataGridTextColumn Binding="{Binding Path=SizeTxt}" Header="Size" SortMemberPath="Size" CellStyle="{StaticResource RightAlignCell}" />
                <DataGridTextColumn Binding="{Binding Path=CheckInDate}" Header="Check in date" />
                <DataGridTextColumn Binding="{Binding Path=Committer}" Header="Committer" />
                <DataGridTextColumn Binding="{Binding Path=Comment}" Header="Comment" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
